2a655f
@@ -940,7 +940,8 @@
boolean isHelpRequest(String line) {
   boolean isComment(String line) {
     // SQL92 comment prefix is "--"
     // beeline also supports shell-style "#" prefix
-    return line.startsWith("#") || line.startsWith("--");
+    String lineTrimmed = line.trim();
+    return lineTrimmed.startsWith("#") || lineTrimmed.startsWith("--");
   }
 
   /**
